/*
 * @Author: linzaifei 1609781601@qq.com
 * @Date: 2025-06-06 10:52:20
 * @LastEditors: linzaifei 1609781601@qq.com
 * @LastEditTime: 2025-08-15 14:25:41
 * @FilePath: /amap-web-vr/src/stores/layer.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export interface ZFLayerModel {
    id:number,
    name:string,
    url:string,
    from:string,
    remarker?:string
}


export const useLayerStore = defineStore('layer', {

    state: () => {
        return {
            layer_detail:true, ///图层详情
            current: {
                id:1,
                url: 'https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
                name: '高德影像地图服务',
                from:"GCJ02"
            } as ZFLayerModel,
            layers: [] as ZFLayerModel[]
        }
    },
    actions: {
        
        loadData(){
          this.layers = [{
            id:1,
            url: 'https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
            name: '高德影像地图服务',
            from:"GCJ02"
          },{
            id:2,
            url:"https://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=436ce7e50d27eede2f2929307e6b33c0",
            name:"天地图(国内可看)",
            remarker:"©天地图GS(2024)0568号",
            from:"WGS84"
          },{
            id:3,
            url:"http://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
            name:"高德(国内可看)",
            remarker:"©高德地图GS(2024)6375",
            from:"GCJ02"
          },{
            id:4,
            url:"http://2.gggis.com/maps/vt?lyrs=s&x={x}&y={y}&z={z}",
            name:"高分精简",
            remarker:"©自定义地图:高分卫星",
            from:"WGS84"
          },{
            id:5,
            url:"https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Earth_at_Night_2016/MapServer/tile/{z}/{y}/{x}",
            name:"全球夜景",
            remarker:"©自定义地图:全球夜景",
            from:"WGS84"
          },{
            id:6,
            url:"https://1.aerial.maps.api.here.com/maptile/2.1/maptile/newest/satellite.day/{z}/{x}/{y}/256/png8?apiKey=aRrXMN6rNeDunujbIgCqESvkttKlk4Pp2j5N7xTp4Ek",
            name:"诺基亚here地图",
            remarker:"©自定义地图:诺基亚here地图",
            from:"WGS84"
          },{
            id:7,
            url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
            name:"arcgis卫星图",
            remarker:"©自定义地图:arcgis卫星图",
            from:"WGS84"
          },{
            id:8,
            url:"https://mt3v.gggis.com/maps/vt?lyrs=s&x={x}&y={y}&z={z}",
            name:"高分极速版【推荐】",
            remarker:"©自定义地图:高分极速版【推荐】",
            from:"WGS84"
          },{
            id:9,
            url:"https://tiles2.geovisearth.com/base/v1/img/{z}/{x}/{y}?format=webp&tmsIds=w&token=fa74f216c7265ac713a224dcd0a4d0f20e27b61051ed729b587111b4c410528b",
            name:"星图地球",
            remarker:"©星图地球",
            from:"WGS84"
          },{
            id:10,
            url:"http://ciwwi.cn/maps/vt?lyrs=s&x={x}&y={y}&z={z}",
            name:"高分精简无路网3",
            remarker:"©自定义地图:高分精简无路网3",
            from:"WGS84"
          }
          ]
          
        },

        onClickLayer(item:ZFLayerModel){
            this.current = item
        }
       
          
    }, 
    persist:true

})
